package com.voilet.interview.open.glide.manager;

import android.support.annotation.NonNull;

import com.voilet.interview.open.glide.RequestManager;

import java.util.Set;

/**
 * Provides access to the relatives of a RequestManager based on the current context. The context
 * hierarchy is provided by nesting in Activity and Fragments; the application context does not
 * provide access to any other RequestManagers hierarchically.
 * 上文提到获取所有childRequestManagerFragments的RequestManager就是通过该类获得，
 * 就一个方法：getDescendants，作用就是基于给定的Context，获取所有层级相关的RequestManager。
 * 上下文层级由Activity或者Fragment获得，ApplicationContext的上下文不会提供RequestManager的层级关系,
 * 而且Application生命周期过长，所以Glide中对请求的控制只针对于Activity和Fragment。
 */
public interface RequestManagerTreeNode {
    /**
     * Returns all descendant {@link RequestManager}s relative to the context of the current
     * {@link RequestManager}.
     */
    @NonNull
    Set<RequestManager> getDescendants();
}
